package com.guigu.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 订单表
 * </p>
 *
 * @author Mr.Zhang
 * @since 2025-03-12
 */
@Data
@TableName("orders")
public class Orders implements Serializable {

    private static final long serialVersionUID=1L;

    //@ApiModelProperty(value = "订单id，主键，自增")
      @TableId(value = "order_id", type = IdType.AUTO)
    private Integer orderId;

    //@ApiModelProperty(value = "订单编号，格式为300+年月日+4位流水号，例如300202212160003")
    private String orderNumber;

    //@ApiModelProperty(value = "下单用户id")
    private Integer consumerId;

    //@ApiModelProperty(value = "商户id")
    private Integer merchantId;

    //@ApiModelProperty(value = "总价")
    private Float totalPrice;

    //@ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createDate;

    //@ApiModelProperty(value = "是否启用，1表示启用，0表示禁用")
    private Integer onOff;

    //@ApiModelProperty(value = "支付方式，P002-1（余额支付）、P002-2（微信支付）、P003（现金支付）")
    private String payMethod;

    //@ApiModelProperty(value = "配送标志，P001-1（待发货）、P001-2（待收货）、P001-3（已收货）、P001-4（已提货）")
    private String conveyTag;

    //@ApiModelProperty(value = "支付标志，K002-1（等待支付）、K002-2（支付失败）、K002-3（支付成功）")
    private String payTag;

    //@ApiModelProperty(value = "退货理由")
    private String backReason;

    //@ApiModelProperty(value = "退货标志")
    private String backTag;

    //@ApiModelProperty(value = "是否删除，C001-1（未删除）、C001-2（已删除）")
    private String status;

    @TableField(exist = false)
    private Consumer consumer;

    @TableField(exist = false)
    private Merchant merchant;

    @TableField(exist = false)
    private List<OrderDetails> orderDetails;

    @TableField(exist = false)
    private Pay pay;


}
